//
//  NSDateFormatter+YCExtension.m
//  YCPublicDemo
//
//  Created by xinhuanwangluo on 2017/5/17.
//  Copyright © 2017年 xinhuanwangluo. All rights reserved.
//

#import "NSDateFormatter+YCExtension.h"

@implementation NSDateFormatter (YCExtension)





+ (NSString *)yc_ymdWithDate:(NSDate *)date {
    
    return [NSDateFormatter yc_stringWithFormatter:@"yyyy-MM-dd HH:mm:ss" date:date];
}


+ (NSString *)yc_stringWithFormatter:(NSString *)formatter date:(NSDate *)date {

    NSDateFormatter * dateFormatter = [[NSDateFormatter alloc] init];
    dateFormatter.dateFormat = formatter;
    return [dateFormatter stringFromDate:date];
}


@end
